import os.path

import yaml


class FileUtil:
    @classmethod
    def get_project_path(cls):
        return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    @classmethod
    def read_yaml(cls, filename):
        _path = os.sep.join([cls.get_project_path(), 'conf', filename + '.yaml'])
        with open(_path, encoding='utf-8') as f:
            return yaml.safe_load(f)
